<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;
class ZhifuController extends Controller
{
    //
    public function Index(Request $request)
    {   
        
    	// dd($request->all());
        $data = $request->only(['id','fukuan']);
        // dd($data['id']);
    	
    	$res = DB::table('dingdan')->where('id',$data['id'])->update(['fukuan' => $data['fukuan']]);
        // dd($res);
        if($res==0){
            return '<script type="text/javascript">alert("已付款");location="/wodedingdan"</script>';
        }
    	// return view('home.tijiaodingdan',['zongjia'=>$zongjia,'id'=>$id,'address'=>$address]);
        return '<script type="text/javascript">alert("支付成功，跳转到我的订单");location="/wodedingdan"</script>';
	}
    	
    
}
